package org.example.logistic.service.impl;

import org.example.comment.utils.ThreadLocalUtil;
import org.example.entity.UserAddresses;
import org.example.logistic.mapper.UserAddressesMapper;
import org.example.logistic.service.UserAddressesService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户地址信息表 服务实现类
 * </p>
 *
 * @author fanfutian
 * @since 2025-05-20
 */
@Service
public class UserAddressesServiceImpl implements UserAddressesService {

    @Autowired
    private UserAddressesMapper userAddressesMapper;

    @Override
    public List<UserAddresses> getAddressesByUserId(Long userId) {
//        Long userId = ThreadLocalUtil.get();
//        if (userId == null){
//            return null;
//        }
        List<UserAddresses> addresses = userAddressesMapper.getAddressesByUserId(userId);
        return addresses;
    }
}
